<%@page contentType="text/html"%>  
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>  
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>  
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   
"http://www.w3.org/TR/html4/loose.dtd">  
<html>
    <head>
        <title>Forma de Pagamento</title>
        <%@include file="../../_include/header.jsp"%>
    </head>
    <style type="text/css"><!--@import url("../../_css/style.css");--></style>
    <body>
        <f:view>
            <t:saveState id="_bean" value="#{FormaPagamentoBean}" />
            <rich:panel>
                <f:facet name="header">
                    <h:outputText value="Forma de Pagamento"/>
                </f:facet>
                <a4j:form id="frmFormaPagamento" status="modalStatus">
                    
                    <h:inputHidden value="#{FormaPagamentoBean.id}" id="id"/>
                    <h:panelGrid columns="3">

                        <h:outputLabel value="Descrição *" for="descricao"/>
                        <h:inputText value="#{FormaPagamentoBean.descricao}" id="descricao" required="true" maxlength="40" style="width:400px;" requiredMessage="Campo Requerido."/>
                        <rich:message for="descricao" style="color:red;"/>

                        <h:outputLabel value="Num Parc Permitidas *" for="parcelasPermitidas"/>
                        <h:inputText value="#{FormaPagamentoBean.parcelasPermitidas}" id="parcelasPermitidas" onkeyup="SomenteNumero(this);" required="true" maxlength="2" style="width:30px;" requiredMessage="Campo Requerido."/>
                        <rich:message for="parcelasPermitidas" style="color:red;"/>

                        <h:outputLabel value="Baixa Automática" for="baixaAutomatica"/>
                        <h:selectBooleanCheckbox value="#{FormaPagamentoBean.baixaAutomatica}"/>
                        <rich:message for="baixaAutomatica" style="color:red;"/>

                    </h:panelGrid>
                    <br><br>
                    <a4j:commandButton value="Salvar" action="#{FormaPagamentoBean.salvar}"/>&nbsp;&nbsp;
                    <a4j:commandButton value="Retornar" action="#{FormaPagamentoBean.retornar}" immediate="true"/>&nbsp;&nbsp;
                </a4j:form>
            </rich:panel>

            <a4j:status id="modalStatus" onstart="Richfaces.showModalPanel('ajaxLoadingModalBox')"
            onstop="Richfaces.hideModalPanel('ajaxLoadingModalBox')" />
            <rich:modalPanel id="ajaxLoadingModalBox" zindex="20000" autosized="true">
                <h:outputText value="Carregando"/><br>
                <h:graphicImage value="../../_images/img_load.gif"/>
            </rich:modalPanel>
        </f:view>
    </body>
</html>